package com.leyou.cart.config;

import com.leyou.cart.intercept.LoginIntercept;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 项目: leyou
 *
 * @author 岩冰
 * @version 2018/10/20 11:17
 */
@Configuration
public class MvcConfig implements WebMvcConfigurer {

    @Autowired
    private LoginIntercept loginIntercept;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginIntercept).addPathPatterns("/**");
    }
}
